# Check Permutation: Given two strings, write a method to decide if one is a permutation of the
# other.

def checkPermutation(s1,s2):
    s1_count = [0]*127
    s2_count = [0]*127

    for x in s1:
        s1_count[ord(x)] += 1
    
    for x in s2:
        s2_count[ord(x)] += 1
    
    return s2_count == s1_count

print(checkPermutation('hello', 'hellosz'))

#Using sort
def checkPermutation(s1, s2):
    return sorted(s1) == sorted(s2)

